package android.snake;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;

public class snake extends Activity {
    private ImageView closeButton;
    private ImageView newGameButton;
    
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        this.newGameButton = (ImageView)this.findViewById(R.id.new_game);
        this.newGameButton.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
            Intent intent = new Intent(snake.this, Game.class);
            try {
            	startActivity(intent);
			} catch (ActivityNotFoundException e) {
				finish();
			}
          }
        });
        
        this.closeButton = (ImageView)this.findViewById(R.id.exit);
        this.closeButton.setOnClickListener(new OnClickListener() {
          public void onClick(View v) {
            finish();
          }
        });
    }
}